package com.github.postsanf.yinian.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;
import android.widget.LinearLayout;

import com.github.postsanf.yinian.R;
import com.umeng.analytics.MobclickAgent;

public class RedPacketDialogActivity extends Activity {
    private String redPacketUrl;
    private LinearLayout noclose;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.act_redpacket_dialog);
        redPacketUrl = getIntent().getStringExtra("url");
        initView();
    }

    private void initView() {
        noclose = (LinearLayout) findViewById(R.id.intent_noclose);
        findViewById(R.id.intent_share).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(RedPacketDialogActivity.this, TodayShareActivityRedpacket.class);
                intent.putExtra("url", redPacketUrl);
                startActivity(intent);
            }
        });
        findViewById(R.id.intent_noclose).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
            }
        });
        findViewById(R.id.pp_regpacket_layout).setOnTouchListener(new View.OnTouchListener() {
            @Override
            public boolean onTouch(View v, MotionEvent event) {
                finish();
                return false;
            }
        });

    }

    // 友盟统计
    public void onResume() {
        super.onResume();
        MobclickAgent.onPageStart(this.getClass().getSimpleName());
        MobclickAgent.onResume(this);
    }

    public void onPause() {
        super.onPause();
        MobclickAgent.onPageEnd(this.getClass().getSimpleName());
        MobclickAgent.onPause(this);
    }
}
